package com;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Gameover extends JFrame {
    JLabel jl;
    JButton  jb2;

    public Gameover(){
        init();
        setTitle("游戏结束");
        setBounds(550,300,300,150);
        setVisible(true);
        setResizable(false);

    }
public void init(){
    setLayout(null);
    jl= new JLabel("抱歉，你死了(T＿T)");
    jl.setBounds(90,20,120,20);

    jb2 = new JButton("游戏结束");
    jb2.setBounds(100,70,100,30);
    this.add(jl);
    this.add(jb2);

    jb2.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          System.exit(0);
 }
    });

}

}
